.data 0x0000

.text 0x0000
start:  lui $1, 0xFFFF
        ori $28, $1, 0xF000

        ori $8,  $0, 0x0000
        ori $9,  $0, 0x0020
        ori $10, $0, 0x0040
        ori $11, $0, 0x0060
        ori $12, $0, 0x0080
        ori $13, $0, 0x00a0
        ori $14, $0, 0x00c0
        ori $15, $0, 0x00e0

        ori $24, $0, 0x0001

assign: 
    lw $5, 0xC70($28)
    sw $5, 0xC60($28)
    sll $6, $5, 24   # y in $a2
    srl $6, $6, 24   
    srl $5, $5, 8    # x in $a1
    j judge

plus:
    add $7, $6, $5   # value in $a3 
    sw $7, 0xC60($28)
    j judge

subs:
    sub $7, $5, $6
    sw $7, 0xC60($28)
    j judge

slll:
    sllv $7, $5, $6
    sw $7, 0xC60($28) 

    slll_review:
    lw $4, 0xc72($28)
    beq $4, $11, slll_review
    J judge

srll:
    srlv $7, $5, $6
    sw $7, 0xC60($28) 

    srll_review:
    lw $4, 0xc72($28)
    beq $4, $12, srll_review

    J judge


whether:
    beq $5, $6, False

    sub $25, $5, $6
    srl $25, $25, 31

    beq $25, $0, True
    False:
    sw $8, 0xC60($28) # 0000 in to memory

    j End_True
    True:
    sw $24, 0xC60($28) #0001 into memory
    End_True:
    j judge

ands:
    and $7, $5, $6
    sw $7, 0xC60($28)
    j judge

xorr:
    xor $7, $5, $6
    sw $7, 0xC60($28)
    j judge

judge:  
    lw $4, 0xc72($28) # case in $a0
    beq $4, $8, assign
    beq $4, $9, plus
    beq $4, $10, subs
    beq $4, $11, slll
    beq $4, $12, srll
    beq $4, $13, whether
    beq $4, $14, ands
    beq $4, $15, xorr
    j judge